package com.education.platform.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.education.platform.entity.DemandReply;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 需求回复Mapper接口
 *
 * @author education-platform
 * @since 2024-09-27
 */
@Mapper
public interface DemandReplyMapper extends BaseMapper<DemandReply> {

    /**
     * 分页查询需求回复列表（带教员信息）
     */
    IPage<DemandReply> selectReplyPageWithTeacher(Page<DemandReply> page, @Param("demandId") Long demandId);

    /**
     * 根据需求ID查询回复列表
     */
    List<DemandReply> selectByDemandId(@Param("demandId") Long demandId);

    /**
     * 根据教员ID查询回复列表
     */
    List<DemandReply> selectByTeacherId(@Param("teacherId") Long teacherId);

    /**
     * 查询教员对特定需求的回复
     */
    DemandReply selectByDemandIdAndTeacherId(@Param("demandId") Long demandId, @Param("teacherId") Long teacherId);

    /**
     * 统计需求的回复数量
     */
    Integer countByDemandId(@Param("demandId") Long demandId);
} 